package javabase.desginpattern.structure.decorator;

import java.math.BigDecimal;

/**
 * @author fance
 * @date 18-4-26 下午4:32
 */
public class Ham extends AbstractCondiment {
    private Pancake pancake;

    public Ham(Pancake pancake) {
        this.pancake = pancake;
    }

    @Override
    public String getName() {
        return pancake.getName() + ",加火腿";
    }

    @Override
    public BigDecimal getPrice() {
        return pancake.getPrice().add(new BigDecimal(2));
    }
}
